﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.DataAccessLayer;

namespace BingZi.HY.Core.Entities.Center
{
	/// <summary>
	/// 公司类型
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("公司类型")]
	[BindTable("app_CompanyType", Description = "公司类型", ConnName = "Center", DbType = DatabaseType.SqlServer)]
	public partial class app_CompanyType
	{
		#region 属性
		private Int32 _CT_ID;
		/// <summary>
		/// 公司类型编号
		/// </summary>
		[Description("公司类型编号")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "CT_ID", "公司类型编号", "", "int", 10, 0, false)]
		public Int32 CT_ID
		{
			get { return _CT_ID; }
			set { if (OnPropertyChange("CT_ID", value)) _CT_ID = value; }
		}

		private String _Name;
		/// <summary>
		/// 名称
		/// </summary>
		[Description("名称")]
		[DataObjectField(false, false, false, 100)]
		[BindColumn(2, "Name", "名称", "", "nvarchar(100)", 0, 0, true)]
		public String Name
		{
			get { return _Name; }
			set { if (OnPropertyChange("Name", value)) _Name = value; }
		}

		private String _Description;
		/// <summary>
		/// 描述
		/// </summary>
		[Description("描述")]
		[DataObjectField(false, false, true, 512)]
		[BindColumn(3, "Description", "描述", "", "nvarchar(512)", 0, 0, true)]
		public String Description
		{
			get { return _Description; }
			set { if (OnPropertyChange("Description", value)) _Description = value; }
		}

		private Int32 _ShowOrder;
		/// <summary>
		/// 显示顺序
		/// </summary>
		[Description("显示顺序")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(4, "ShowOrder", "显示顺序", "0", "int", 10, 0, false)]
		public Int32 ShowOrder
		{
			get { return _ShowOrder; }
			set { if (OnPropertyChange("ShowOrder", value)) _ShowOrder = value; }
		}

        private Int32 _State;
		/// <summary>
		/// 状态
		/// </summary>
		[Description("状态")]
		[DataObjectField(false, false, false, 3)]
		[BindColumn(5, "State", "状态", "0", "tinyint", 3, 0, false)]
        public Int32 State
		{
			get { return _State; }
			set { if (OnPropertyChange("State", value)) _State = value; }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "CT_ID" : return _CT_ID;
					case "Name" : return _Name;
					case "Description" : return _Description;
					case "ShowOrder" : return _ShowOrder;
					case "State" : return _State;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "CT_ID" : _CT_ID = Convert.ToInt32(value); break;
					case "Name" : _Name = Convert.ToString(value); break;
					case "Description" : _Description = Convert.ToString(value); break;
					case "ShowOrder" : _ShowOrder = Convert.ToInt32(value); break;
					case "State" : _State = Convert.ToInt32(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得公司类型字段名的快捷方式
		/// </summary>
		public class _
		{
			///<summary>
			/// 公司类型编号
			///</summary>
			public const String CT_ID = "CT_ID";

			///<summary>
			/// 名称
			///</summary>
			public const String Name = "Name";

			///<summary>
			/// 描述
			///</summary>
			public const String Description = "Description";

			///<summary>
			/// 显示顺序
			///</summary>
			public const String ShowOrder = "ShowOrder";

			///<summary>
			/// 状态
			///</summary>
			public const String State = "State";
		}
		#endregion
	}
}